package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.mapper.CustomerReportMapper;
import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.service.ICustomerReportService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by GG on 2020/3/27.
 */
@Service
public class CustomerReportImpl implements ICustomerReportService {
    @Autowired
    private CustomerReportMapper customerReportMapper;

    @Override
    public PageInfo selectCustomerReport(QueryObject qo) {
         PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
        List<Map> list = customerReportMapper.selectCustomerReport(qo);

        return new PageInfo(list);
    }
    //创建一个map集合,用来查询x轴和y轴的数据,图形报表不需要分页
    public List<Map> listAll(QueryObject qo){
        return customerReportMapper.selectCustomerReport(qo);
    }
}
